package com.example.graduatetest.view.model;

import android.app.Activity;
import android.view.View;
import android.widget.Toast;

import androidx.appcompat.widget.Toolbar;
import androidx.lifecycle.ViewModel;

import com.example.graduatetest.R;
import com.example.graduatetest.databinding.ActivityAboutBinding;

public class AboutViewModel extends ViewModel {
    private Activity activity;
    private ActivityAboutBinding binding;
    public void init(Activity activity,ActivityAboutBinding binding){
        this.activity =activity;
        this.binding = binding;
        toolbarInit();
    }
    //初始课程
    private void toolbarInit(){
        Toolbar toolbar = binding.toolbar9;
        toolbar.setTitle("关于易打卡");
        toolbar.setNavigationIcon(R.drawable.ic_arrow_back_black_24dp);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                activity.onBackPressed();
            }
        });

    }

    public void checkUpdate(){
        Toast.makeText(activity, "已是最新版本", Toast.LENGTH_SHORT).show();
    }
}
